<template>
  <view class="buildingactivities">
    <text class="title">党建活动</text>
    <view class="content">
      <image
        :src="image(datas[0].face_image_id)"
        alt=""
        srcset=""
        class="buildingactivities-img"
        @tap="()=>todetail(datas[0]._id)"
      />

      <image
        :src="image(datas[1].face_image_id)"
        alt=""
        srcset=""
        class="buildingactivities-img"
        @tap="()=>todetail(datas[1]._id)"
      />
    </view>
  </view>
</template>

<script>
import "./index.scss";
import Taro from "@tarojs/taro";
import request, { getImage } from "../../../../utils/request";
// face_image_id
export default {
  data() {
    return {
      datas: [{ face_image_id: "" }, { face_image_id: "" }],
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      request("get", "/api/rest/articles.htm", {
        q_category_id: "5c46cf73b5773c375f1a8285",
        row_limit: 2, //每页记录数，非必填
        p: 1,
      }).then((res) => {
        // console.log(res, "党建活动");
        this.datas = res._list;
      });
    },

    todetail(id) {
      // console.log(this.data.id, "ooo");
      Taro.navigateTo({ url: `/pages/culture/cultruedetail/index?id=${id}` });
    },

    image(id){
      return getImage(id)
    }
  },
};
</script>
